//#include <stdint.h>
#include "apt32f102_gpio.h"
#include "apt32f102_adc.h"


#ifndef CHIP_H
#define CHIP_H

typedef enum
{
    ADC_Switch = 0, 
    ADC_Oven = 1, 
    ADC_Meat1 = 2, 
    ADC_Meat2 = 3, 
    ADC_BAT_V = 4, 
    ADC_INTVREF_1v = 5,

    ADC_Length = 6 
}ADC_Seq_E;


//Key
#define IO_Key1 EXI6 //PA
#define IO_Key2 EXI7 //PA

//Switch Key
#define IO_Switch EXI11 //PA
#define ADC_Channel_Switch ADC12_ADCIN12

//Temp
#define IO_Oven EXI5 //PA5
#define IO_Probe1 EXI10 //PA10 第二个孔作为Probe1
#define IO_Probe2 EXI9 //PA9
#define ADC_Channel_Oven  ADC12_ADCIN4 //烤炉AD通道
#define ADC_Channel_Meat1 ADC12_ADCIN11  //肉探针1AD通道
#define ADC_Channel_Meat2 ADC12_ADCIN10  //肉探针2AD通道

//Motor control
#define IO_Heater EXI2 //PB //点火风扇
#define IO_Feed EXI3 //PB //进料风扇
#define IO_Fan EXI8 //PA //排气风扇

void SystemConfig(void);
uint32_t SamplingSingle(uint32_t channel);

#endif
